home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / Q-R / Regions.cpt / Regions.rsrc / TBUF_128_'howto' < prev    next >
Text File  |  1988-02-05  |  974b  |  16 lines

  1. How to use a 'RGN ' created by this program:
  2. Assuming that an OffScreen bitmap containing an image has been created.. all that is needed to use a 'RGN ' resource created by this program is to first load it with something like the following:
  3.  
  4. var
  5.   myRgn: RgnHandle;
  6. begin
  7.   myRgn := RgnHandle(GetResource('RGN ',resID));{resID = resource ID}
  8. end;
  9.  
  10. then... plug it into the CopyBits() call:
  11.  
  12. CopyBits(OffScreen,myWindow^.portBits,sRect,dRect,srcCopy,myRgn);
  13.  
  14. CopyBits will clip to myRgn... so that nothing is drawn outside the Region.  If dRect does not intersect the region then nothing is drawn.  If the Region is not located in the proper place, it can be moved via the OffSetRgn() call.  See Inside Macintosh for more Region information.
  15.  
  16. 'Region Demo' uses a 'large' region created by this program.  First we CopyBits() using the region.. Then to 'Invert it!' we create a new region which is the DiffRgn() of the first region and a rectangular region of our window area.